<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link rel="stylesheet" href="css/common.css" type="text/css" />
        <link href="js/uploadify/uploadify.css" rel="stylesheet" type="text/css">
        <link href="css/adminstyle.css" rel="stylesheet" type="text/css">
        <title>
            管理区域
        </title>
        <script language="javascript" type="text/javascript" src="js/jquery-1.9.1.js">
        </script>
        <script language="javascript" type="text/javascript" src="js/uploadify/swfobject.js">
        </script>
        <script language="javascript" type="text/javascript" src="js/uploadify/jquery.uploadify.v2.1.4.js">
        </script>
    </head>
    
    <body>
        <div id="man_zone">
            <form method="post" action="<?$id = isset($_GET['id'])?$_GET['id']:'';
            if  (empty($id)){ echo  'news_subAdd.html'; }else{ echo  'news_subUpdate.html'; }?>">
                <input name="id" type="hidden" id="id" value="<?=$id?>">
                <input name="nav_id" type="hidden" id="nav_id" value="<?=$nav_id?>">
                <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1"
                class="tableborder">
                    <tr bgcolor="#ffffff">
                        <td class="left_title_2adminssd"> 标题      </td>
                        <td>
                            <input name="title" type="text" value="<?=getStr($extract_vars,'title')?>" size="100">
                        </td>
                    </tr>
                 	<tr bgcolor="#ffffff">
                        <td class="left_title_2adminssd"> 推广关键字      </td>
                        <td>
                            <input name="key_title" type="text" value="<?=getStr($extract_vars,'key_title')?>" size="100">(逗号分隔,4,5个最佳)
                        </td>
                    </tr>                  
                 	<tr bgcolor="#ffffff">
                        <td class="left_title_2adminssd"> 推广内容      </td>
                        <td>
                            <textarea name="key_content" rows="10" cols="150"><?=getStr($extract_vars, 'key_content')?></textarea>
                        </td>
                    </tr>          
                 	<tr bgcolor="#ffffff">
                        <td class="left_title_2adminssd"> 新闻来源   </td>
                        <td>
                            <input name="news_source" type="text" value="<?=getStr($extract_vars,'news_source')?>" size="50">(自己编译:100课堂,转载:请注明出处,否则,空)
                        </td>
                    </tr>                                   
                    <?if(isset($_GET['pub_type'])&&$_GET['pub_type']>0){?>
                    	<input type="hidden" name="pub_type" value="<?=$_GET['pub_type']?>">
                    	<input type="hidden" name="type" value="<?=$_GET['pub_type']?>">
                    	<?if($_GET['pub_type']==NEWS_PUB_TYPE_LIST){?>
	                    <tr bgcolor="#ffffff">
	                          <td class="left_title_2adminssd">栏目 </td>
	                        	<td>
		                           <select name="nav_id">
										<?=$newsPubnavOption?>
		                            </select>	                        	
	                        	</td>
	                    </tr>
	                    <?}else{?>
	                    <tr bgcolor="#ffffff">
	                          <td class="left_title_2adminssd">栏目 </td>
	                        	<td>
	                        	<?=$pub_nav_pair[$nav_id]?>
	                        	</td>
	                    </tr>	                    
	                    <?}?>
                    <?}else{?>
                    <tr bgcolor="#ffffff">
                          <td class="left_title_2adminssd">类型 </td>
                        	<td>
                            <select name="type">
								<?=$newsTypeOption?>
                            </select>
                        </td>
                    </tr>
                    <?}?>
                    <?if(isset($_GET['pub_type'])&&$_GET['pub_type']>0){?>
	                    <?if($_GET['pub_type']==NEWS_PUB_TYPE_LIST){?> 
	                    <tr bgcolor="#ffffff">
	                          <td class="left_title_2adminssd">推荐状态 </td>
	                        	<td>
	                            <select name="recom_status">
	                            	<?=$newsRecoStatusOption?>
	                            </select>
	                        </td>
	                    </tr>
	                    <tr bgcolor="#ffffff">
	                          <td class="left_title_2adminssd">发布状态 </td>
	                        	<td>
	                            <select name="pub_status">
	                            	<?=$newsPubStatusOption?>
	                            </select>
	                        </td>
	                    </tr>
	                    <?}else{?>
	                    <input type="hidden" name="recom_status" value="1" id="recom_status">
	                    <input type="hidden" name="pub_status" value="1" id="pub_status">
	                    <?}?>
                    <?}?>
                   <tr bgcolor="#ffffff">
                        <td class="left_title_2adminssd">
                           	 列表图片((W)230px*154px(H))
                        </td>
                        <td bgcolor="#FFFFFF" colspan="3">
                            &nbsp;&nbsp;&nbsp;
                            <?php $display_style='none'; $upload_value="";?>
                            <?if(getStr($extract_vars, 'pic')!="" ){?>
                                <? $display_style='inline-block' ;?>
                                    <? $upload_value=htmlspecialchars(getStr($extract_vars, 'pic'));?>
                                        <?}?>
                                            <input id="file_upload_pic" name="file_upload_pic"  id2="5" class="file_upload"   type="file" multiple="true">
                                            <br>
                                            <a href="javaScript:void(0);" class="del_file" style="display:<?=$display_style?>">&nbsp;&nbsp;&nbsp;&nbsp;删除附件                </a>
                                            <a class="file_link" href="<?=SITE_URL.$upload_value?>" target="_blank" style="display:<?=$display_style?>"  />                  查看            </a>
                                            <input type="hidden" class="file_src" name="pic" value="<?=$upload_value?>"  id="pic">
                        </td>
                    </tr>
                    <tr bgcolor="#ffffff">
                        <td class="left_title_2adminssd">
                           	 详细图片
                        </td>
                        <td bgcolor="#FFFFFF" colspan="3">
                            &nbsp;&nbsp;&nbsp;
                            <?php $display_style='none'; $upload_value="";?>
                            <?if(getStr($extract_vars, 'detail_pic')!="" ){?>
                                <? $display_style='inline-block' ;?>
                                    <? $upload_value=htmlspecialchars(getStr($extract_vars, 'detail_pic'));?>
                                        <?}?>
                                            <input id="file_upload_detail_pic" name="file_upload_detail_pic"  id2="5" class="file_upload"   type="file" multiple="true">
                                            <br>
                                            <a href="javaScript:void(0);" class="del_file" style="display:<?=$display_style?>">&nbsp;&nbsp;&nbsp;&nbsp;删除附件                </a>
                                            <a class="file_link" href="<?=SITE_URL.$upload_value?>" target="_blank" style="display:<?=$display_style?>"  />                  查看            </a>
                                            <input type="hidden" class="file_src" name="detail_pic" value="<?=$upload_value?>"  id="detail_pic">
                        </td>
                    </tr>                    
                    <tr bgcolor="#ffffff">
                        <td class="left_title_2adminssd">
                           	 视频文件
                        </td>
                        <td bgcolor="#FFFFFF" colspan="3">
                            &nbsp;&nbsp;&nbsp;
                            <?php $display_style='none'; $upload_value="";?>
                            <?if(getStr($extract_vars, 'video')!="" ){?>
                                <? $display_style='inline-block' ;?>
                                    <? $upload_value=htmlspecialchars(getStr($extract_vars, 'video'));?>
                                        <?}?>
                                            <input id="file_upload_video" name="file_upload_video"  id2="5" class="file_upload"   type="file" multiple="true">
                                            <br>
                                            <a href="javaScript:void(0);" class="del_file" style="display:<?=$display_style?>">&nbsp;&nbsp;&nbsp;&nbsp;删除附件                </a>
                                            <a class="file_link" href="<?=SITE_URL.$upload_value?>" target="_blank" style="display:<?=$display_style?>"  />                  查看            </a>
                                            <input type="hidden" class="file_src" name="video" value="<?=$upload_value?>"  id="video">
                        </td>
                    </tr>                    
                    <tr bgcolor="#ffffff">
                        <td class="left_title_2adminssd">
                            	简介
                        </td>
                        <td>
  						<textarea name="smalltext" rows="10" cols="150"><?=getStr($extract_vars, 'smalltext')?></textarea>
                        </td>
                    </tr>
                    <tr bgcolor="#ffffff">
                        <td class="left_title_2adminssd">
                            		内容
                        </td>
                        <td>
                            <?=$ueditor?>
                                <?=$content?>
                        </td>
                    </tr>
                    <tr bgcolor="#ffffff">
                        <td colspan="2" align="center">
                            <input name="input" type="button" class="PublicBot" value="返回" onclick="window.history.go(-1);"     />
                            
                            <input name="submit" class="PublicBot"  type="submit" value="提交" />
                        </td>
                    </tr>
                </table>
            </form>
        </div>
        <script type="text/javascript">
            $(document).ready(function() {
                $(function() {
                    $('.file_upload').uploadify({
                        'uploader': 'js/uploadify/uploadify.swf',
                        'script': 'js/uploadify/uploadify.php',
                        'cancelImg': 'js/uploadify/cancel.png',
                        'folder': '5',
                        'auto': true,
                        'fileExt': '*.gif;*.jpg;;*.swf',
                        'fileDesc': 'Web Image Files (*.GIF,*.JPG,*.SWF)',
                        'sizeLimit': '12097152',
                        'onComplete': function(event, ID, fileObj, response, data) {
                            $("#" + $(event.target).attr("id")).nextAll(".del_file").show();
                            $("#" + $(event.target).attr("id")).nextAll(".file_src").val(response);
                            $("#" + $(event.target).attr("id")).nextAll(".file_link").attr("href", "../" + response);
                            $("#" + $(event.target).attr("id")).nextAll(".file_link").show();
                        }
                    });
                });
            });

            $(".del_file").click(function() {
                if (confirm("您确认要删除该附件么？")) {
                    $(this).hide();
                    $(this).nextAll(".file_src").val("");
                    $(this).nextAll(".file_link").attr("href", "");
                    $(this).nextAll(".file_link").hide();
                    alert("附件已成功删除");
                }
            })
        </script>
    </body>

</html>